#!/bin/bash


#
# Convert an image cropping it to a square
#
# ----------
# -- Args --
# ----------
# > width of the new image
# > rotation of the image 

`dirname $0`/convertResize $1 | \
convert - \
          -bordercolor white  -border 6 \
          -bordercolor grey60 -border 1 \
          -background  none   -rotate $2 \
          -background  black  \( +clone -shadow 60x4+4+4 \) +swap \
          -background  none  -flatten  "${3:-png}":-
